#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    srand(time(NULL));
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    ui->label->setText("白头偕老");
}

void Widget::on_pushButton_2_pressed()
{
    QRect rect = this->geometry();
    int x = rand()%rect.x();
    int y = rand()%rect.y();
    ui->pushButton_2->move(x,y);
}
